<?php

{$AUTO_GENERATOR_INCLUDE_HEADER_TEMPLATE}

defined('_JEXEC') or die;

class {$AUTO_GENERATOR_COMPONENT|capitalize}Model{$AUTO_GENERATOR_MODEL|capitalize} extends JModelAdmin
{

    protected $text_prefix = 'COM_{$AUTO_GENERATOR_COMPONENT|upper}';

    public function getForm($data = array(), $loadData = true)
    {
        $form = $this->loadForm('com_{$AUTO_GENERATOR_COMPONENT|lower}.{$AUTO_GENERATOR_XML_FORM|lower}', '{$AUTO_GENERATOR_MODEL|lower}', array('control' => 'jform', 'load_data' => $loadData));

        if (empty($form))
        {
            return false;
        }

        return $form;
    }

    public function getTable($type = '{$AUTO_GENERATOR_TABLE_TITLE|capitalize}', $prefix = '{$AUTO_GENERATOR_COMPONENT|capitalize}Table', $config = array())
    {
        return JTable::getInstance($type, $prefix, $config);
    }

    protected function loadFormData()
    {
        $data = JFactory::getApplication()->getUserState('com_{$AUTO_GENERATOR_COMPONENT|lower}.edit.{$AUTO_GENERATOR_MODEL|lower}.data', array());

        if (empty($data))
        {
            $data = $this->getItem();
        }

        return $data;
    }

    protected function getReorderConditions($table)
    {
        $condition = array();

        return $condition;
    }

    protected function prepareTable($table)
    {
        
    }

}
